package com.eatme.core.design.pattern.behavioral.observer;

public class Test {
    public static void main(String[] args) {
        Course course = new Course("Java设计精讲");
        Teacher teacher = new Teacher("Eatme");
        Teacher teacher2 = new Teacher("Beta");
        course.addObserver(teacher);
        course.addObserver(teacher2);
        //业务逻辑代码
        Question question = new Question();
        question.setUserName("tymls");
        question.setQuestionContent("Java的主函数如何编写");
        course.produceQuestion(course,question);
    }

}
